﻿using System;

namespace Spencen.Mobile.Markup.Converters
{
    public class NullConverter : IConverter<object>
    {
        private const string NullText = "{x:null}";

        #region IConverter<object> Members

        public object ConvertFromString( string input, Type toType )
        {
            return null;
        }

        public string ConvertToString( object input )
        {
            return NullText;
        }

        public bool CanConvertFromString( string input, Type toType )
        {
            return input == NullText;
        }

        #endregion
    }
}
